<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE GeneralizedNewtypeDeriving #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-- | Free regs map for PowerPC</span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.CmmToAsm.Reg.Linear.PPC</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.PPC.Regs.html"><span class="hs-identifier">GHC.CmmToAsm.PPC.Regs</span></a></span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.Class.html"><span class="hs-identifier">GHC.Platform.Reg.Class</span></a></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html"><span class="hs-identifier">GHC.Platform.Reg</span></a></span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Word.html#"><span class="hs-identifier">Data.Word</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-comment">-- The PowerPC has 32 integer and 32 floating point registers.</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- This is 32bit PowerPC, so Word64 is inefficient - two Word32s are much</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- better.</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Note that when getFreeRegs scans for free registers, it starts at register</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- 31 and counts down. This is a hack for the PowerPC - the higher-numbered</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- registers are callee-saves, while the lower regs are caller-saves, so it</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- makes sense to start at the high end.</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- Apart from that, the code does nothing PowerPC-specific, so feel free to</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- add your favourite platform to the #if (if you have 64 registers but only</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- 32-bit words).</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">data</span><span> </span><span id="FreeRegs"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FreeRegs"><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-30"></span><span>              </span><span class="hs-keyword">deriving</span><span class="hs-special">(</span><span> </span><span id="local-6989586621681009643"><span id="local-6989586621681009645"><span id="local-6989586621681009651"><span class="annot"><span class="annottext">RegNo -&gt; FreeRegs -&gt; ShowS
[FreeRegs] -&gt; ShowS
FreeRegs -&gt; String
(RegNo -&gt; FreeRegs -&gt; ShowS)
-&gt; (FreeRegs -&gt; String) -&gt; ([FreeRegs] -&gt; ShowS) -&gt; Show FreeRegs
forall a.
(RegNo -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [FreeRegs] -&gt; ShowS
$cshowList :: [FreeRegs] -&gt; ShowS
show :: FreeRegs -&gt; String
$cshow :: FreeRegs -&gt; String
showsPrec :: RegNo -&gt; FreeRegs -&gt; ShowS
$cshowsPrec :: RegNo -&gt; FreeRegs -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span> </span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- The Show is used in an ASSERT</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681009639"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-33"></span><span>    </span><span id="local-6989586621681009636"><span class="annot"><span class="annottext">ppr :: FreeRegs -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; (FreeRegs -&gt; String) -&gt; FreeRegs -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FreeRegs -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#noFreeRegs"><span class="hs-identifier hs-type">noFreeRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span>
</span><span id="line-36"></span><span id="noFreeRegs"><span class="annot"><span class="annottext">noFreeRegs :: FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#noFreeRegs"><span class="hs-identifier hs-var hs-var">noFreeRegs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0</span></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#releaseReg"><span class="hs-identifier hs-type">releaseReg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span>
</span><span id="line-39"></span><span id="releaseReg"><span class="annot"><span class="annottext">releaseReg :: RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#releaseReg"><span class="hs-identifier hs-var hs-var">releaseReg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Platform.Reg.html#RealRegSingle"><span class="hs-identifier hs-type">RealRegSingle</span></a></span><span> </span><span id="local-6989586621681009628"><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009628"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span id="local-6989586621681009627"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009627"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621681009626"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009626"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009628"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">31</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009627"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009626"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; RegNo -&gt; Word32
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009628"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; RegNo
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">32</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009627"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; RegNo -&gt; Word32
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009628"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009626"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#releaseReg"><span class="hs-identifier hs-var">releaseReg</span></a></span><span> </span><span class="annot"><span class="annottext">RealReg
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">FreeRegs
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-44"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FreeRegs
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RegAlloc.Linear.PPC.releaseReg: bad reg&quot;</span></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#initFreeRegs"><span class="hs-identifier hs-type">initFreeRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span>
</span><span id="line-47"></span><span id="initFreeRegs"><span class="annot"><span class="annottext">initFreeRegs :: Platform -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#initFreeRegs"><span class="hs-identifier hs-var hs-var">initFreeRegs</span></a></span></span><span> </span><span id="local-6989586621681009620"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009620"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(FreeRegs -&gt; RealReg -&gt; FreeRegs)
-&gt; FreeRegs -&gt; [RealReg] -&gt; FreeRegs
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RealReg -&gt; FreeRegs -&gt; FreeRegs)
-&gt; FreeRegs -&gt; RealReg -&gt; FreeRegs
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#releaseReg"><span class="hs-identifier hs-var">releaseReg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#noFreeRegs"><span class="hs-identifier hs-var">noFreeRegs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.PPC.Regs.html#allocatableRegs"><span class="hs-identifier hs-var">allocatableRegs</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681009620"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#getFreeRegs"><span class="hs-identifier hs-type">getFreeRegs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.Class.html#RegClass"><span class="hs-identifier hs-type">RegClass</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- lazily</span><span>
</span><span id="line-50"></span><span id="getFreeRegs"><span class="annot"><span class="annottext">getFreeRegs :: RegClass -&gt; FreeRegs -&gt; [RealReg]
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#getFreeRegs"><span class="hs-identifier hs-var hs-var">getFreeRegs</span></a></span></span><span> </span><span id="local-6989586621681009615"><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621681009615"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span id="local-6989586621681009614"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009614"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621681009613"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009613"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="GHC.Platform.Reg.Class.html#RcDouble"><span class="hs-identifier hs-var">RcDouble</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621681009615"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; RegNo -&gt; [RealReg]
forall {a}. (Num a, Bits a) =&gt; a -&gt; a -&gt; RegNo -&gt; [RealReg]
</span><a href="#local-6989586621681009611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009613"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0x80000000</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">63</span></span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="GHC.Platform.Reg.Class.html#RcInteger"><span class="hs-identifier hs-var">RcInteger</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621681009615"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; RegNo -&gt; [RealReg]
forall {a}. (Num a, Bits a) =&gt; a -&gt; a -&gt; RegNo -&gt; [RealReg]
</span><a href="#local-6989586621681009611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009614"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0x80000000</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">31</span></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; [RealReg]
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RegAllocLinear.getFreeRegs: Bad register class&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RegClass -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RegClass
</span><a href="#local-6989586621681009615"><span class="hs-identifier hs-var">cls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-55"></span><span>        </span><span id="local-6989586621681009611"><span class="annot"><span class="annottext">go :: a -&gt; a -&gt; RegNo -&gt; [RealReg]
</span><a href="#local-6989586621681009611"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="#local-6989586621681009611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621681009593"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009593"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681009592"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009592"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621681009591"><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009591"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009593"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009592"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RegNo -&gt; RealReg
</span><a href="GHC.Platform.Reg.html#RealRegSingle"><span class="hs-identifier hs-var">RealRegSingle</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009591"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">RealReg -&gt; [RealReg] -&gt; [RealReg]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a -&gt; RegNo -&gt; [RealReg]
</span><a href="#local-6989586621681009611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009593"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009592"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; RegNo -&gt; a
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(RegNo -&gt; [RealReg]) -&gt; RegNo -&gt; [RealReg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009591"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; RegNo
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; RegNo -&gt; [RealReg]
</span><a href="#local-6989586621681009611"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009593"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681009592"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; RegNo -&gt; a
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(RegNo -&gt; [RealReg]) -&gt; RegNo -&gt; [RealReg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009591"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; RegNo
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">1</span></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#allocateReg"><span class="hs-identifier hs-type">allocateReg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Platform.Reg.html#RealReg"><span class="hs-identifier hs-type">RealReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span>
</span><span id="line-60"></span><span id="allocateReg"><span class="annot"><span class="annottext">allocateReg :: RealReg -&gt; FreeRegs -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#allocateReg"><span class="hs-identifier hs-var hs-var">allocateReg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Platform.Reg.html#RealRegSingle"><span class="hs-identifier hs-type">RealRegSingle</span></a></span><span> </span><span id="local-6989586621681009585"><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009585"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-type">FreeRegs</span></a></span><span> </span><span id="local-6989586621681009584"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009584"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621681009583"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009583"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009585"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">31</span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009584"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009583"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#complement"><span class="hs-identifier hs-var">complement</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; RegNo -&gt; Word32
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009585"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo -&gt; RegNo -&gt; RegNo
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><span class="hs-number">32</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-62"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; FreeRegs
</span><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#FreeRegs"><span class="hs-identifier hs-var">FreeRegs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009584"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32
forall a. Bits a =&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#complement"><span class="hs-identifier hs-var">complement</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; RegNo -&gt; Word32
forall a. Bits a =&gt; a -&gt; RegNo -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">RegNo
</span><a href="#local-6989586621681009585"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621681009583"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><a href="GHC.CmmToAsm.Reg.Linear.PPC.html#allocateReg"><span class="hs-identifier hs-var">allocateReg</span></a></span><span> </span><span class="annot"><span class="annottext">RealReg
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">FreeRegs
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-65"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FreeRegs
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RegAlloc.Linear.PPC.allocateReg: bad reg&quot;</span></span><span>
</span><span id="line-66"></span></pre></body></html>